package com.canbot.u05.activity.reception;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;

import com.canbot.u05.activity.BaseActivityNoTitle;
import com.canbot.u05.utils.ConstUtils;

/**
 * Created by Administrator on 2017/3/13.
 */

public class ReceptionBaseActivity extends BaseActivityNoTitle {

        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, intentFilter);
        }

        protected IntentFilter intentFilter = new IntentFilter(ConstUtils.ACTION_MEETING_EXIT);

        protected BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
                @Override
                public void onReceive(Context context, Intent intent) {
                        finish();
                }
        };

        @Override
        protected void onDestroy() {
                LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
                super.onDestroy();
        }
}
